package com.github.wxiaoqi.security.biz.modules.menuShow.api;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.wxiaoqi.security.biz.modules.menuShow.biz.CmsMainMenuBiz;
import com.github.wxiaoqi.security.biz.modules.menuShow.entity.CmsMainMenu;
import com.github.wxiaoqi.security.common.cms.request.CmsQueryMainMenuParam;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.util.ResponseHelper;

import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;

@Api(tags="首页菜单列表")
@Slf4j
@Controller
@RequestMapping("cmsMainMenus")
public class CmsMainMenuController extends BaseController<CmsMainMenuBiz,CmsMainMenu> {

	@ResponseBody
	@RequestMapping(value = "/list", method = RequestMethod.POST)
	public Map<String, Object> query(@RequestBody CmsQueryMainMenuParam param) {
		log.info("查询首页菜单列表-----start------{}", param);
		param.setPlatformId(setPlatformId(param.getPlatformId()));
		List<CmsMainMenu> list = baseBiz.getMenuList(param);
		if (list != null) {
			return ResponseHelper.success(list, null, "200", "查询成功");
		}else {
			return ResponseHelper.success(null, null, "403", "列表不存在");
		}
	}
	
}